using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UI_Text : BaseUI
{
    public Button bt;
    public static string key = "UItext";

    private void Awake()
    {
        //UIManager.showUIs?.Add("UItext", this);
        UIManager.showUIs?.Add(UI_Text.key, this);
        bt = gameObject.GetComponent<Button>();
        bt.onClick.AddListener(onClick);
        //绑定事件
        EventManager.Ins.AttachEvent(key, UItext);
        //定义窗口性质 (默认数值)
        //窗口类型
        currentUIType.type = UIFormType.Normal;
        //窗口所在节点
        currentUIType.mode = UIFormShowMode.Normal;
        /// UI窗体透明度类型
        currentUIType.lucenyType = UIFormLucenyType.Lucency;
    }
    private void onClick()
    {
        EventManager.Ins.TriggerEvent(key);
    }
    /// <summary>
    /// 按下事件
    /// </summary>
    /// <param name="o"></param>
    public void UItext(object o = null)
    {
        //UIManager.instance.CloseUI(key);
        //UIManager.instance.ExitUI(key);
          // UIManager.instance.EnterUIAndHideOther(UI_MainMenu.key);
          // UIManager.instance.CloseUI(UI_MainMenu.key);
        Debug.Log("UI生命周期管理");


    }
}
